home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 272_01 / basename.doc < prev    next >
Text File  |  1987-07-08  |  1KB  |  39 lines

  1.  
  2.  
  3.         NAME
  4.                 basename -- split a string into path and/or filename
  5.  
  6.         SYNOPSIS
  7.                 void basename(s1, s2, s3);
  8.                 char *s1;      original string
  9.                 char *s2;      destination for path portion
  10.                 char *s3;      destination for name portion
  11.  
  12.         DESCRIPTION
  13.         This function will split a potential filename specification into
  14.         the subdirectory path and the filename itself.  The split
  15.         is made at the final '\' character.  If none exists, s3 will
  16.         be the same as s1, and s2[0] will be NULL.  If only a path
  17.         exists, s2 equals s1, and s3[0] is NULL.
  18.  
  19.         EXAMPLE
  20.              char *name[] = "C:\looney\bin\wumpus.com";
  21.              char path[32], file[16];
  22.              basename(name, path, file);
  23.  
  24.              after execution, arrays are as follows (NULL terminated):
  25.                 *name (unchanged)
  26.                 *path C:\looney\bin\
  27.                 *file wumpus.com
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.         This function is found in SMDLx.LIB for the Datalight Compiler.
  39.